#include <stdio.h>
#include <assert.h>

struct s{
	int number;
	char name[20];
	int score[3];
	float ava;
}s1;
//int main(void)
//{
//	FILE* in;
//	FILE *out;
//	char ch;
//	in=fopen("C:\\Users\\Administrator\\Desktop\\in.txt","r");
//	out=fopen("C:\\Users\\Administrator\\Desktop\\out.txt","w");
//	assert(in!=NULL);
//	assert(out!=NULL);
//	while((ch=fgetc(in))!=EOF)//()
//		fputc(ch,out);
//	fclose(in);
//	fclose(out);
//	return 0;
//}
//int main()
//{
//	FILE * in=fopen("C:\\Users\\Administrator\\Desktop\\input.txt","r");
//	int sum=0,i=0;
//	assert(in!=NULL);
//	while(!feof(in))
//	{
//		fscanf(in,"%d %s",&s1.number,s1.name);
//		for(i=0,sum=0;i<3;i++) //sum=0
//		{
//			fscanf(in,"%d",&s1.score[i]);
//			sum+=s1.score[i];
//		}
//		s1.ava=sum/3.0;
//		printf("%3d %s",s1.number,s1.name);
//		for(int i=0;i<3;i++) 
//		{
//			printf("%3d ",s1.score[i]);
//		}
//		printf("%7.2f\n",s1.ava);
//	}
//	fclose(in);
//	return 0;
//}
int main()
{
	FILE * fout=fopen("C:\\Users\\Administrator\\Desktop\\output.txt","w");
	int sum=0,i=0,n=0;
	assert(fout!=NULL);
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d %s",&s1.number,s1.name);
		for(i=0;i<3;i++) scanf("%d",&s1.score[i]);
		fprintf(fout,"%3d %s",s1.number,s1.name);
		for(i=0,sum=0;i<3;i++) 
		{
			fprintf(fout,"%3d",s1.score[i]);
			sum+=s1.score[i];
		}
		s1.ava=sum/3.0;
		fprintf(fout,"%7.2f\n",s1.ava);
	}
	fclose(fout);
	return 0;
}